<?php
/**
 * Created by PhpStorm.
 * User: boye009
 * Date: 2016/3/15
 * Time: 10:45
 * editor : zhouzhou
 */

namespace app\index\domain;

use app\index\domain\BaseDomain;
use app\shop\api\RedEnvelopeApi;

class RedEnvelopeDomain extends BaseDomain{
    protected $business_code = 'redEnvelope';

    //红包查询 不分页
    public function query(){
        $this->checkVersion(101);
        addLog("RedEnvelope/query",$_GET,$_POST,"应用" . $this->client_id . "调用红包查询接口");
        $uid       = $this -> _post('uid',0,"用户id缺失");
        $is_use    = $this -> _post('is_use',0);
        $is_expire = $this -> _post('is_expire',0);

        $is_use    = intval($is_use);
        $is_expire = intval($is_expire);
        $result = apiCall(RedEnvelopeApi::QUERY_WITH_TPL,[$uid,$is_use,$is_expire]);

        if($result['status']){
            $this -> apiReturnSuc($result['info']);
        }else{
            $this -> apiReturnErr($result['info']);
        }
    }

}